import request from '@/router/axios';
import {
	baseUrl
} from '@/config/env';

export const loginByUsername = (loginname, password) => request({
	url: baseUrl + '/api/account/login',
	method: 'get',
	params: {
		loginname,
		password,
		type:'WEB'
	}
});

export const updateDept = (dept) => request({
	url: baseUrl + '/api/user/updateDept',
	method: 'get',
	params: {
		dept
	}
});

export const getButtons = () => request({
	url: baseUrl + '/api/account/getbuttons',
	method: 'get'
});

export const getUserInfo = () => request({
	url: baseUrl + '/api/user/getUserInfo',
	method: 'get'
});

export const refeshToken = () => request({
	url: baseUrl + '/api/user/refresh',
	method: 'get'
});

export const getMenu = (pid) => request({
	url: baseUrl + '/api/Menu/getMenuBtn',
	method: 'get',
	params: {
		pid,
	}
});

export const getTopMenu = () => request({
	url: baseUrl + '/api/Menu/authmenu',
	method: 'get'
});

export const sendLogs = (list) => request({
	url: baseUrl + '/api/user/logout',
	method: 'post',
	data: list
})

export const logout = () => request({
	url: baseUrl + '/api/account/logout',
	method: 'get'
})
